﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Construction.Core
{
    public class nBeams: cObj
    {
        private List<cObj> contents;
        public nBeams()
        { 
            contents = new List<cObj>();
        }
        public double ChieuDai { set; get; }

        public double ChieuRong { set; get; }

        public double ChieuCao { set; get; }
        public override void Add(cObj obj)
        {
            if (!(obj is iBeams) && !(obj is iBearing)) return;
            obj.OwnerID = base.BaseID;
            this.contents.Add(obj);
            base.Add(obj);
        }
        public override void Add(cObj obj, int index)
        {
            if (!(obj is iBeams) && !(obj is iBearing)) return;
            obj.OwnerID = base.BaseID;
            this.contents.Insert(index, obj);
            base.Add(obj, index);
        }
        public List<iBeams> ListBeamsSpan
        {
            get
            {
                return (from e in this.contents
                        where e is iBeams
                        select e as iBeams).ToList<iBeams>();
            }
        }
        public List<iBearing> ListBearing
        {
            get
            {
                return (from e in this.contents
                        where e is iBearing
                        select e as iBearing).ToList<iBearing>();
            }
        }
    }
}
